<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>项目管理</title>
    <meta name="description" content="">
    <meta name="author" content="templatemo">
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/templatemo-style.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/teacher.js"></script>
</head>

<body>
    <?php  
    require_once("./system/loginCheck.php");
    require_once("../congfig/config.php");
     ?>
    <!-- Left column -->
    <div class="templatemo-flex-row">
        <div class="templatemo-sidebar">
            <header class="templatemo-site-header">
                <div class="square"></div>
                <h1>教师管理系统</h1>
            </header>
            <div class="profile-photo-container">
                <img src="images/profile-photo.jpg" alt="Profile Photo" class="img-responsive">
            </div>
            <!-- Search box -->

            <div class="mobile-menu-icon">
                <i class="fa fa-bars"></i>
            </div>
            <nav class="templatemo-left-nav">
                <ul>
                    <li><a href="../index.php"><i class="fa fa-map-marker fa-fw"></i>首页</a></li>
                    <li id="xmgl"><a href="project-list.php" class="active"><i class="fa fa-bars fa-fw"></i>我的项目</a>
                    </li>
                    <li id="yhgl"><a href="addProject.php"><i class="fa fa-fire fa-fw"></i>发布项目</a></li>
                    <li id="grxx"><a href="tOwner.php" ><i class=" fa fa-user fa-fw"></i>个人信息</a></li>
                    <li><a href="pad-check.php"><i class="fa fa-cog fa-fw"></i>修改密码</a></li>
                    <li><a href="../loginout.php"><i class="fa fa-map-marker fa-fw"></i>注销</a></li>
                </ul>
            </nav>
        </div>
        <!-- Main content -->
        <div class="templatemo-content col-1 light-gray-bg" style="height:1000px;">
            <div class="container" style="margin-top:100px;">
                <a style="font-size:18px; color:rgb(19,137,95);" href="project-list.php"><i class="fa fa-arrow-circle-left fa-fw"></i>
                    返 回</a>
                <div id="alterProjectUser" style="margin-top: 30px;">
                    <?php 
                    $pid=$_GET["pid"];
                    $teacherid=$_SESSION['loginflag'];
                     ?>
                    <table class="table table-hover  table-striped">
                        <thead>
                            <tr>
                                <th class="col-md-2">编号</th>
                                <th class="col-md-7">项目成员</th>
                                <th class="col-md-3">操作</th>
                            </tr>
                        </thead>
                        <?php 
                    $sql="select * from puser where pid=$pid";
                    $result=$conn->query($sql);
                    while($row=$result->fetch_array())
                        { 
                            if ($row["uid"]!=$teacherid) {
                                $uid=$row["uid"];
                                $sql1="select * from users where uid = $uid";
                                $result1=$conn->query($sql1);
                                $row1=$result1->fetch_array();
                                ?>
                                <tbody>
                            <tr>
                                <td id="uid" class="col-md-2"><?php echo $row["uid"]; ?></td>
                                <td class="col-md-7"><?php echo $row1["username"]; ?></td>
                                <td class="col-md-3"><a href="doalterProjectUser.php?pid=<?php echo $pid ; ?>&uid=<?php echo $row["uid"]; ?>" class="btn btn-xs btn-danger" onclick="return confirm('真的删除吗')">删除</a> </td>

                            </tr>
                        </tbody><?php  }
                           
                        };

                         ?>  
                    </table>
                          
                        
                </div>
            </div>
        </div>
    </div><?php 
               if (isset($_GET["text"])) {
                  $text=$_GET["text"];
                  echo "<script>alert('$text')</script>";
               } ?>
</body>

</html>
